home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17761 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.8 KB

  1. Path: ctp.com!news
  2. From: Eddy Wong <ewong@ctp.com>
  3. Newsgroups: comp.lang.c++,ctp.lang.c++
  4. Subject: Re: Class definitions for C++ exceptions hierarchy?
  5. Date: Wed, 17 Apr 1996 13:40:21 +0200
  6. Organization: Cambridge Technology Partners
  7. Message-ID: <3174D8A5.7CCD@ctp.com>
  8. References: <4l16vd$jbo@concorde.ctp.com>
  9. NNTP-Posting-Host: 149.44.27.81
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.01Gold (WinNT; I)
  14.  
  15. Hi Ben,
  16.  
  17. In the Philips project we're using a hierarchy of exceptions 
  18. based on severity rather than type of error:
  19.  
  20. Exception
  21.     FatalException
  22.     SeriousException
  23.     WarningException
  24.  
  25. Errors of the same severity are handled in a similar fashion.
  26. FatalExceptions pops up an error and quits, SeriousException causes 
  27. the process to pop up an error information dialogue box and to ask for 
  28. "ignore" or "abort" and WarningException causes the system to write some 
  29. information in a log file. We might end up deriving new classes 
  30. from these base classes.
  31.  
  32. Please post or email your results, I'm interested in what you
  33. come up with.
  34.  
  35.  
  36. Eddy.
  37.  
  38. Benjamin Lurie wrote:
  39. > In Scott Meyers' book "More Effective C++ -- 35 New Ways to
  40. > Improve Your Programs and Designs" he talks about the
  41. > "diagnostics portion of the hierarchy of exceptions defined
  42. > by the standard C++ library".  This hierarchy looks something
  43. > like the following:
  44. >         exception
  45. >                 logic_error
  46. >                         domain_error
  47. >                         invalid_argument
  48. >                         length_error
  49. >                         out_of_range
  50. >                 runtime_error
  51. >                         range_error
  52. >                         overflow_error
  53. > I was wondering if someone had (or could point me to) the definition
  54. > for these exception classes.  I assume that they all derive from
  55. > the xmsg class (or maybe that is a bad assumption)?
  56. > I am thinking of emulating or creating these classes myself and
  57. > using the hierarchy in our project.  Any comments on this idea?
  58. > Thanks,
  59. > Ben
  60. > ----------------------------------------------------------------------------
  61. > CAMBRIDGE      Benjamin Lurie             Tel:  (617) 374-8374
  62. > TECHNOLOGY     Senior Software Developer
  63. > PARTNERS       Operations
  64. > ----------------------------------------------------------------------------
  65.  
  66. -- 
  67.  /\/\ | Eddy Wong                               ewong@ctp.com           |
  68. / /_.\| Cambridge Technology Partners, Inc.     (617) 374-9800          |
  69. \  /./| 304 Vassar St, Cambridge, MA 02139      (617) 374-8300 (fax)    |
  70.  \/\/ | USA                                                             |
  71.  
  72.  
  73. Currently at:
  74.  
  75. Philips Dictation Systems GmbH          Tel.:   +43 1 60101 1685
  76. Attn.: CTP - Eddy Wong                  Fax:    +43 1 60101 1817
  77. Computerstrasse 6
  78. A-1101, Vienna, Austria
  79.